package jdk;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;


class A{
	public static void a(String s) {
		s += "aaaa";
		System.out.println(s);
	}
}
class B{
	public static void b(String s) {
		s = Character.toUpperCase(s.charAt(0))+s.substring(1);
		System.out.println(s);
	}
}
public class ConsumerDemo {
	
	public static void main(String[] args) {
		Consumer<String> con = System.out::println; 
		con.accept("aaaaaaaaaaaaa");
		List<String> list = Arrays.asList("abc","www","ddd","yyy","uuu");
		list.forEach(System.out::println);
		Consumer<String> con2 = A::a;
		con2.accept("www");
		Consumer<String> con3 = B::b;
		con3.accept("hello world");
	}
}
